package cn.cn.day14;

import javax.swing.text.html.HTMLDocument;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;

public class TestIterator {
    public static void main(String[] args) {
        Integer[] a = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
        print(a);
        String[] b = {"大哥", "二哥", "三哥", "四哥", "五哥", "六哥", "小弟"};
        print(b);
        Double[] c = {6.0, 6.6, 6.66, 6.666, 6.6666};
        print(c);
    }
    private static <E>void print(E[] e){

        List list=new ArrayList<>(Arrays.asList(e));
       // System.out.println(list);
        Iterator<E> aa=list.iterator();
        while (aa.hasNext()){
            System.out.println(aa.next());
        }
    }
}
